def analyze_text(text):
    letters = digits = spaces = others = 0
    for char in text:
        if char.isalpha():
            letters += 1
        elif char.isdigit():
            digits += 1
        elif char.isspace():
            spaces += 1
        else:
            others += 1
    return{
        'letters': letters,
        'digits': digits,
        'spaces': spaces,
        'others': others,
    }

print(analyze_text("hello world 123 &*"))